/**
 * 
 */
package com.lehecai.core.lottery;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.lehecai.core.IntegerBeanLabelItem;

/**
 * @author qatang
 * 平台类型
 */
public class PlatformType extends IntegerBeanLabelItem {


	private static final long serialVersionUID = -530998782071935781L;

	protected static final Logger logger = LoggerFactory.getLogger(PlatformType.class.getName());
	
	private static List<PlatformType> items = new ArrayList<PlatformType>();
	private static List<PlatformType> _items = new ArrayList<PlatformType>();
	private static List<PlatformType> itemsForRate = new ArrayList<PlatformType>();
	
	protected PlatformType(String name, int value) {
		super(PlatformType.class.getName(), name, value);
		if (value != -1) {
			_items.add(this);
		}
		if (value > 0) {
			itemsForRate.add(this);
		}
		items.add(this);
	}
	
	public static PlatformType getItem(int value) {
		// 平台号存在特殊定义，需要做特殊处理
		if (contain(value)) {
			// 对于存在的定义，直接返回实际类型
			return (PlatformType)PlatformType.getResult(PlatformType.class.getName(), value);
		}
		// > 1000，都认为是新版手机客户端使用的OPENAPI
		if (value > 1000) {
			return USER_PLATFORM_OPENAPI;
		}
		// 其他情况，返回未知
		return UNKNOWN;
	}
	
	public static boolean contain(int value) {
		return PlatformType.contain(PlatformType.class.getName(), value);
	}
	
	public static List<PlatformType> getItems() {
		return items;
	}
	
	public static List<PlatformType> getSelectItems() {
		return _items;
	}

	public static List<PlatformType> getItemsForRate() {
		return itemsForRate;
	}
	
	public static final PlatformType ALL = new PlatformType("全部", -1);

	public static final PlatformType UNKNOWN = new PlatformType("未知", 0);
	
	public static final PlatformType USER_PLATFORM_MAIN = new PlatformType("网页主平台", 1);
	public static final PlatformType USER_PLATFORM_WAP = new PlatformType("WAP", 2);
	public static final PlatformType USER_PLATFORM_ADMIN = new PlatformType("后台", 3);
	public static final PlatformType USER_PLATFORM_OPENAPI = new PlatformType("OPENAPI", 4);
	
	public static final PlatformType USER_PLATFORM_GAME = new PlatformType("游戏", 5);
	public static final PlatformType USER_PLATFORM_TOUCH = new PlatformType("wap触屏版", 6);
	public static final PlatformType USER_PLATFORM_PASSPORT = new PlatformType("通行证", 7);
	public static final PlatformType USER_PLATFOMR_DRAWSVC = new PlatformType("开奖数据服务", 8);

	public static final PlatformType USER_PLATFORM_WAP_HOOPCHINA = new PlatformType("WAP_hoopchina", 200);
	public static final PlatformType USER_PLATFORM_WAP_78500 = new PlatformType("WAP_78500", 201);
	public static final PlatformType USER_PLATFORM_WAP_HICLOUD = new PlatformType("WAP_HICLOUD", 202);
    public static final PlatformType USER_PLATFORM_WAP_518CAI = new PlatformType("WAP_518CAI", 203);
    public static final PlatformType USER_PLATFORM_WAP_SOHU = new PlatformType("WAP_SOHU", 204);

    public static final PlatformType USER_PLATFORM_TOUCH_HOOPCHINA = new PlatformType("TOUCH_hoopchina", 300);
    public static final PlatformType USER_PLATFORM_TOUCH_SOHU = new PlatformType("TOUCH_sohu", 301);
    public static final PlatformType USER_PLATFORM_TOUCH_KOUDAIGOUWU = new PlatformType("TOUCH_口袋购物", 302);
    public static final PlatformType USER_PLATFORM_TOUCH_WEIXIN = new PlatformType("TOUCH_微信", 303);
    public static final PlatformType USER_PLATFORM_TOUCH_IEADU = new PlatformType("TOUCH_易读", 304);
    public static final PlatformType USER_PLATFORM_TOUCH_BAIDUTIEBA = new PlatformType("TOUCH_百度贴吧", 305);
    public static final PlatformType USER_PLATFORM_TOUCH_58 = new PlatformType("TOUCH_58", 306);

	public static final PlatformType USER_PLATFORM_TOUCH_NEIQIAN_BAIDUTIEBA = new PlatformType("贴吧内嵌版", 307);
	public static final PlatformType USER_PLATFORM_TOUCH_NEIQIAN_BAIDUBAIFUBAO = new PlatformType("百付宝内嵌版", 308);
	public static final PlatformType USER_PLATFORM_TOUCH_58_NEIQIANBAN = new PlatformType("58内嵌版", 309);

	public static final PlatformType USER_PLATFORM_MOBILE_GENERIC = new PlatformType("默认的手机客户端", 999);
	public static final PlatformType USER_PLATFORM_MOBILE_J2ME = new PlatformType("j2me客户端", 100);
	public static final PlatformType USER_PLATFORM_MOBILE_IPHONE = new PlatformType("iphone客户端", 101);
	public static final PlatformType USER_PLATFORM_MOBILE_ANDROID = new PlatformType("android客户端", 102);
	public static final PlatformType USER_PLATFORM_MOBILE_KJAVA = new PlatformType("kjava客户端", 103);


    public static final PlatformType USER_PLATFORM_IPHONE_APPSTORE_MAIN = new PlatformType("iPhone_AppStore标准版", 1001);
    public static final PlatformType USER_PLATFORM_IPHONE_MAIN = new PlatformType("iPhone标准版", 1003);
    public static final PlatformType USER_PLATFORM_IPHONE_WAP = new PlatformType("iPhone_WAP下载标准版", 1004);
    public static final PlatformType USER_PLATFORM_ANDROID_MAIN = new PlatformType("Android_主站下载标准版", 1005);
    public static final PlatformType USER_PLATFORM_ANDROID_WAP = new PlatformType("Android_WAP下载标准版", 1006);

    public static final PlatformType USER_PLATFORM_ANDROID_BAIDUSEM = new PlatformType("Android_百度SEM", 11001);
    public static final PlatformType USER_PLATFORM_ANDROID_SOGOUSEM = new PlatformType("Android_搜狗SEM", 11002);
    public static final PlatformType USER_PLATFORM_ANDROID_BAIDUOPEN = new PlatformType("Android_百度开发者平台", 11003);
    public static final PlatformType USER_PLATFORM_ANDROID_NEWREADTIME = new PlatformType("Android_新阅读时代", 11009);
    public static final PlatformType USER_PLATFORM_ANDROID_QIANCE = new PlatformType("Android_千策网络", 11010);
    public static final PlatformType USER_PLATFORM_ANDROID_SAMSUNG_APPSTORE = new PlatformType("Android_三星应用商店", 11011);
    public static final PlatformType USER_PLATFORM_ANDROID_MM_STORE = new PlatformType("Android_MM商城", 11012);

	public static final PlatformType USER_PLATFORM_ANDROID_SOGOU_MOBILE_VR = new PlatformType("搜狗无线VR", 11013);
	public static final PlatformType USER_PLATFORM_ANDROID_91CPTCPS = new PlatformType("91安卓（CPT+CPS)", 11014);
	public static final PlatformType USER_PLATFORM_ANDROID_SINA_WEIBO = new PlatformType("新浪微博", 11015);
	public static final PlatformType USER_PLATFORM_ANDROID_HUAWEI_APPSTORE = new PlatformType("华为应用市场", 11016);
	public static final PlatformType USER_PLATFORM_ANDROID_ALIYUN_APPSTORE = new PlatformType("阿里云应用", 11017);
	public static final PlatformType USER_PLATFORM_ANDROID_ANDROID_DOWNLOAD = new PlatformType("安卓应用下载", 11018);
	public static final PlatformType USER_PLATFORM_ANDROID_ZOL_APPSTORE = new PlatformType("zol应用中心", 11019);
	public static final PlatformType USER_PLATFORM_ANDROID_GOOGLEPLAY = new PlatformType("googleplay", 11020);
	public static final PlatformType USER_PLATFORM_ANDROID_BANMA_APPSTORE = new PlatformType("斑马应用商店", 11021);
	public static final PlatformType USER_PLATFORM_ANDROID_NENGZHUSHOU = new PlatformType("能助手", 11022);

	public static final PlatformType USER_PLATFORM_ANDROID_ANRUAN_APPSTORE = new PlatformType("安软市场", 11023);
	public static final PlatformType USER_PLATFORM_ANDROID_AMAZON_APPSTORE = new PlatformType("亚马逊应用商店", 11024);
	public static final PlatformType USER_PLATFORM_ANDROID_ANDROID_APPSTORE = new PlatformType("安卓商店", 11025);

	public static final PlatformType USER_PLATFORM_ANDROID_TAOBAO_PHONE_ASSISTANT = new PlatformType("淘宝手机助手", 11026);
	public static final PlatformType USER_PLATFORM_ANDROID_DIANXIN_APPSTORE = new PlatformType("点心应用市场", 11027);
	public static final PlatformType USER_PLATFORM_ANDROID_QIHULU_APPSTORE = new PlatformType("七葫芦应用市场", 11028);
	public static final PlatformType USER_PLATFORM_ANDROID_XUNLEI_ASSISTANT = new PlatformType("迅雷手机助手", 11029);
	public static final PlatformType USER_PLATFORM_ANDROID_YIYONGHUI = new PlatformType("易用汇", 11030);
	public static final PlatformType USER_PLATFORM_ANDROID_LIQU_APPSTORE = new PlatformType("历趣市场", 11031);
	public static final PlatformType USER_PLATFORM_ANDROID_MAOPAO_APPSTORE = new PlatformType("冒泡市场", 11032);
	public static final PlatformType USER_PLATFORM_ANDROID_BAORUANWANG = new PlatformType("宝软网", 11033);
	public static final PlatformType USER_PLATFORM_ZHUODASHI_APPSTORE = new PlatformType("卓大师应用市场", 11034);
	public static final PlatformType USER_PLATFORM_ANDROID_JIKEWANG = new PlatformType("机客网", 11035);

	public static final PlatformType USER_PLATFORM_ANDROID_SOHU_PASSPORT_TWO = new PlatformType("搜狐通行证2", 11036);
	public static final PlatformType USER_PLATFORM_ANDROID_HAO123_APPSTORE = new PlatformType("hao123应用市场", 11037);
	public static final PlatformType USER_PLATFORM_ANDROID_BAIDU_BRANDLINK = new PlatformType("百度品专", 11038);
	public static final PlatformType USER_PLATFORM_ANDROID_BAIDU_WUXIAN_SEM = new PlatformType("百度无线SEM", 11039);
	public static final PlatformType USER_PLATFORM_ANDROID_OFFLINE_SPREAD_ONE = new PlatformType("线下推广1", 11040);
	public static final PlatformType USER_PLATFORM_ANDROID_OFFLINE_SPREAD_TWO = new PlatformType("线下推广2", 11041);
	public static final PlatformType USER_PLATFORM_ANDROID_OFFLINE_SPREAD_THREE = new PlatformType("线下推广3", 11042);
	public static final PlatformType USER_PLATFORM_ANDROID_BAIDU_MOBILESEARCH_SPREAD = new PlatformType("百度移动搜索APP推广", 11043);
	public static final PlatformType USER_PLATFORM_ANDROID_SOHU_MOBILE_SEM = new PlatformType("搜狐无线SEM", 11044);
	public static final PlatformType USER_PLATFORM_ANDROID_BAIDU_ASSISTOR = new PlatformType("百度助手", 11045);

	public static final PlatformType USER_PLATFORM_ANDROID_SHAIHAI_SUBWAY = new PlatformType("上海地铁", 11046);
	public static final PlatformType USER_PLATFORM_ANDROID_SHAIHAI_AIRPORT_TICKET = new PlatformType("上海机场办票大厅", 11047);
	public static final PlatformType USER_PLATFORM_ANDROID_SHAIHAI_AIRPORT_DEPARTURE_LOUNGE = new PlatformType("上海机场候机大厅", 11048);
	public static final PlatformType USER_PLATFORM_ANDROID_BEIJING_SUBWAY_XIZHIMENG_TRANSFER = new PlatformType("北京地铁西直门换乘区", 11049);
	public static final PlatformType USER_PLATFORM_ANDROID_TIANANMENG_EAST = new PlatformType("公益天安门东", 11050);
	public static final PlatformType USER_PLATFORM_ANDROID_WANGFUJING = new PlatformType("公益王府井", 11051);
	public static final PlatformType USER_PLATFORM_ANDROID_DONGDAN = new PlatformType("公益东单", 11052);
	public static final PlatformType USER_PLATFORM_ANDROID_YONGANLI = new PlatformType("公益永安里", 11053);
	public static final PlatformType USER_PLATFORM_ANDROID_GUOMAO = new PlatformType("公益国贸", 11054);
	public static final PlatformType USER_PLATFORM_ANDROID_DAWANGLU = new PlatformType("公益大望路", 11055);

	public static final PlatformType USER_PLATFORM_ANDROID_SIHUI = new PlatformType("公益四惠", 11056);
	public static final PlatformType USER_PLATFORM_ANDROID_SIHUI_EAST = new PlatformType("公益四惠东", 11057);
	public static final PlatformType USER_PLATFORM_ANDROID_BAIDU_WALLET_PRIVATE = new PlatformType("百度钱包专享版", 11058);
	public static final PlatformType USER_PLATFORM_ANDROID_91SHENZHEN = new PlatformType("91深圳地推", 11059);
	public static final PlatformType USER_PLATFORM_ANDROID_BAIDU_ROM_HUNDRED = new PlatformType("百度rom100", 11060);
	public static final PlatformType USER_PLATFORM_ANDROID_WANDOJIA_TWO = new PlatformType("豌豆荚2", 11061);
	public static final PlatformType USER_PLATFORM_ANDROID_MORE_APPSTORE = new PlatformType("N多市场", 11062);
	public static final PlatformType USER_PLATFORM_ANDROID_MOBILE_CHINA = new PlatformType("手机中国", 11063);
	public static final PlatformType USER_PLATFORM_ANDROID_MOBILE_HOME = new PlatformType("手机之家", 11064);
	public static final PlatformType USER_PLATFORM_ANDROID_NANJING_EAST_PAPER = new PlatformType("南京东方卫报", 11065);

	public static final PlatformType USER_PLATFORM_ANDROID_NANJING_SUBWAY = new PlatformType("南京地铁", 11066);
	public static final PlatformType USER_PLATFORM_ANDROID_BEIJING_SUBWAY_PUBLIC_WELFARE = new PlatformType("北京地铁公益", 11067);
	public static final PlatformType USER_PLATFORM_ANDROID_BAIDU_ROM_MY_WORLDCUP = new PlatformType("百度ROM我的世界杯", 11068);
	public static final PlatformType USER_PLATFORM_ANDROID_518CAI = new PlatformType("518彩", 11069);
	public static final PlatformType USER_PLATFORM_ANDROID_APP_WALL = new PlatformType("应用墙", 11070);

	public static final PlatformType USER_PLATFORM_IPHONE_APPSTORE_91LCCP = new PlatformType("iPhoneAppStore_91乐彩彩票", 12001);
	public static final PlatformType USER_PLATFORM_IPHONE_APPSTORE_APPLELIFE = new PlatformType("iPhoneAppStore_生活分类版", 12002);

	public static final PlatformType USER_PLATFORM_MAIN_BAIDU = new PlatformType("网页主平台_baidu", 500);
	public static final PlatformType USER_PLATFORM_MAIN_SOHU = new PlatformType("网页主平台_sohu", 501);
	public static final PlatformType USER_PLATFORM_MAIN_HOOPCHINA = new PlatformType("网页主平台_hoopchina", 502);
	public static final PlatformType USER_PLATFORM_MAIN_GANJI = new PlatformType("网页主平台_ganji", 503);
	public static final PlatformType USER_PLATFORM_MAIN_CHINA = new PlatformType("网页主平台_china", 504);
	public static final PlatformType USER_PLATFORM_MAIN_VIP = new PlatformType("网页主平台_vip", 505);
	public static final PlatformType USER_PLATFORM_MAIN_78500 = new PlatformType("网页主平台_78500", 506);
	public static final PlatformType USER_PLATFORM_MAIN_BAOFENG = new PlatformType("网页主平台_baofeng", 507);
	public static final PlatformType USER_PLATFORM_MAIN_518CAI = new PlatformType("网页主平台_518cai", 508);
	public static final PlatformType USER_PLATFORM_MAIN_FJSEN = new PlatformType("网页主平台_东南网", 509);
	public static final PlatformType USER_PLATFORM_MAIN_CCSTOCK = new PlatformType("网页主平台_中国资本证券网", 510);
	public static final PlatformType USER_PLATFORM_MAIN_HAO123 = new PlatformType("网页主平台_hao123彩票", 511);
	public static final PlatformType USER_PLATFORM_MAIN_520 = new PlatformType("网页主平台_520彩票", 512);
	public static final PlatformType USER_PLATFORM_MAIN_SOTIPS = new PlatformType("网页主平台_智彩彩票", 513);
	public static final PlatformType USER_PLATFORM_MAIN_ACFUN = new PlatformType("网页主平台_acfun彩票", 514);
	public static final PlatformType USER_PLATFORM_MAIN_BAIDU_YOUXI = new PlatformType("网页主平台_百度游戏", 515);
	public static final PlatformType USER_PLATFORM_MAIN_LKGAME = new PlatformType("网页主平台_老K游戏彩票", 516);
    public static final PlatformType USER_PLATFORM_MAIN_BAIDU_TIEBA = new PlatformType("网页主平台_百度贴吧", 517);
    public static final PlatformType USER_PLATFORM_MAIN_UNION = new PlatformType("网页主平台_乐彩联盟", 518);
    public static final PlatformType USER_PLATFORM_MAIN_58 = new PlatformType("网页主平台_58彩票", 519);
    public static final PlatformType USER_PLATFORM_MAIN_BAIDU_CAIPIAO = new PlatformType("网页主平台_百度彩票", 520);

}
